<template>
<div :class="['div-tag', 'div-'+level]">
    <slot>一级</slot>
</div>
</template>

<script>
export default {
    name: "myTag",
    props: {
        level: { /* 1、2、3 */
            type: Number,
            default: 1
        }
    }
}
</script>

<style scoped>
.div-tag {
    width: 80px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    font-size: 16px;
    transition: background-color 0.32s;
    box-sizing: border-box;
}
.div-1 {
    border: 1px solid rgb(255, 40, 255);
    background-color: rgba(255, 40, 255, 0.73);
}
.div-2 {
    border: 1px solid rgb(255, 40, 130);
    background-color: rgba(255, 40, 130, 0.73);
}
.div-3 {
    border: 1px solid rgb(169, 40, 255);
    background-color: rgba(169, 40, 255, 0.73);
}
</style>